<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="js/vue.js"></script>
</head>
<body>

<div id="app">
    <input type="text" v-model="name">
    <input type="radio" name="sex" value="nan">男
    <input type="radio" name="sex" value="nv">女
    <button @click="save">添加</button>
    <p>添加姓名和性别:</p>
    <ul>
        <li v-for="n in names">{{n}}</li>
    </ul>
</div>
<script>
    let app = new Vue({
       el:"#app",
       data:{
           names:[],
           name:''
       },
        methods:{
           save:function () {
               this.names.push(this.name);
           }
        }
    });
</script>

</body>
</html>